const  {Tray} = require('electron')
 createTray =(app,win,trayMenu)=>{
    const tray = new Tray('icon.png')
     tray.setToolTip('念君')
     tray.on('click',(e)=>{
         console.log('点击了托盘',e)
         // const wcs =win.webContents
         // wcs.on('context-menu',(e,params)=>{
         //     trayMenu.popup()
         // })

         if (e.shiftKey){
             app.quit()
         }else {
             tray.setContextMenu(trayMenu)
            // win.isVisible()?win.hide():win.show()
         }

     })
 }
module.exports = createTray
